package org.viettan.android.main.model;

import java.util.Locale;

public enum Language {

    ENGLISH("en", Locale.ENGLISH),
    VIETNAMESE("vi", new Locale("vi")),
    FRENCH("fr", Locale.FRENCH);

    private String code;
    private Locale locale;

    private Language(String code, Locale locale) {
	this.code = code;
	this.locale = locale;
    }

    /**
     * Returns the 2-letter lowercase code for this language
     *
     * @return
     */
    public String getCode() {
	return code;
    }

    /**
     * Returns the locale of this language.
     */
    public Locale getLocale() {
	return locale;
    }

    /**
     * Returns the 2-letter lowercase code for this language
     *
     * @return
     */
    @Override
    public String toString() {
	return code;
    }
}
